GetSkeleton

カテゴリ

アニメーション

詳細

スケルトン内のオブジェクト(ルート、ボーン、およびエフェクタ)を取得します。

注: このコマンドは、出力引数を使用します。 C# および一部のスクリプト言語(JScript、PerlScript、Python など)は、リファレンスによって渡される引数をサポートしていません。 通常、出力引数は XSIApplication.ExecuteCommand メソッド(C#)または ISIVTCollection (スクリプト言語)を介して取得できますが、このコマンドはすでに値を返しています。

この場合の唯一の回避策は、出力引数と戻り値の両方を 1 つの配列で戻す VBScript のカスタム コマンドを作成することです。 詳細については、「関数がすでに値を戻している場合の処理について」を参照してください。

スクリプト構文

oReturn = GetSkeleton( InputObj, [Index] );

戻り値

ルート、ボーン、およびエフェクタを(この順序で)含む XSICollection を戻します。

パラメータ

パラメータ タイプ 詳細
InputObj 文字列 スケルトン内のオブジェクト(ルート、ボーン、およびエフェクタ)
Index Integer スケルトン内のオブジェクトのインデックスを戻します。

デフォルト値: 0

指定可能な値:

説明:

0 根元
[1..NbElements-2] ボーン
NbElements-1 Effector

VBScript の例

' The following creates a 3 bones skeleton, asks for info using the second bone
' and prints out the    bone index, the total number of elements in the skeleton 
' and selects the root. It also activates the joints rotation limits.
dim MySkeleton, BoneIndex, NbElements, MyRoot
Create2DSkeleton -3.004, 2.152, 0.000, -1.531, -1.163, 0.000, 0.000, 0.000, 1.000, 1 
AppendBone , 0.853, 1.396, 0.000 
AppendBone , 2.578, -1.532, 0.000
set MySkeleton =  GetSkeleton("bone1", BoneIndex )
NbElements = MySkeleton.count 
LogMessage "Element Index: " & Index 
LogMessage "Nb Elements: " & NbElements
'Select skeleton root   
MyRoot = MySkeleton(0)
SelectObj( MyRoot )
for i=1 to NbElements-2
        'Activate the RotationLimits on every joint (except the effector joint)
        SetValue MySkeleton(i) & ".joint.rotlim_active", TRUE
next